home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / AIFF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  5.2 KB  |  254 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        AIFF.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __AIFF__
  18. #define __AIFF__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. #if GENERATINGPOWERPC
  31. #pragma options align=mac68k
  32. #endif
  33.  
  34. #ifdef __CFM68K__
  35. #pragma lib_export on
  36. #endif
  37.  
  38.  
  39. enum {
  40.     AIFFID                        = 'AIFF',
  41.     AIFCID                        = 'AIFC',
  42.     FormatVersionID                = 'FVER',
  43.     CommonID                    = 'COMM',
  44.     FORMID                        = 'FORM',
  45.     SoundDataID                    = 'SSND',
  46.     MarkerID                    = 'MARK',
  47.     InstrumentID                = 'INST',
  48.     MIDIDataID                    = 'MIDI',
  49.     AudioRecordingID            = 'AESD',
  50.     ApplicationSpecificID        = 'APPL',
  51.     CommentID                    = 'COMT',
  52.     NameID                        = 'NAME',
  53.     AuthorID                    = 'AUTH',
  54.     CopyrightID                    = '(c) ',
  55.     AnnotationID                = 'ANNO'
  56. };
  57.  
  58. enum {
  59.     NoLooping                    = 0,
  60.     ForwardLooping                = 1,
  61.     ForwardBackwardLooping        = 2,
  62. /* AIFF-C Versions */
  63.     AIFCVersion1                = 0xA2805140L
  64. };
  65.  
  66. /* Compression Names */
  67. #define NoneName "\pnot compressed"
  68. #define ACE2to1Name "\pACE 2-to-1"
  69. #define ACE8to3Name "\pACE 8-to-3"
  70. #define MACE3to1Name "\pMACE 3-to-1"
  71. #define MACE6to1Name "\pMACE 6-to-1"
  72.  
  73. enum {
  74. /* Compression Types */
  75.     NoneType                    = 'NONE',
  76.     ACE2Type                    = 'ACE2',
  77.     ACE8Type                    = 'ACE8',
  78.     MACE3Type                    = 'MAC3',
  79.     MACE6Type                    = 'MAC6'
  80. };
  81.  
  82. typedef unsigned long ID;
  83.  
  84. typedef short MarkerIdType;
  85.  
  86. struct ChunkHeader {
  87.     ID                                ckID;
  88.     long                            ckSize;
  89. };
  90. typedef struct ChunkHeader ChunkHeader;
  91.  
  92. struct ContainerChunk {
  93.     ID                                ckID;
  94.     long                            ckSize;
  95.     ID                                formType;
  96. };
  97. typedef struct ContainerChunk ContainerChunk;
  98.  
  99. struct FormatVersionChunk {
  100.     ID                                ckID;
  101.     long                            ckSize;
  102.     unsigned long                    timestamp;
  103. };
  104. typedef struct FormatVersionChunk FormatVersionChunk;
  105.  
  106. typedef FormatVersionChunk *FormatVersionChunkPtr;
  107.  
  108. struct CommonChunk {
  109.     ID                                ckID;
  110.     long                            ckSize;
  111.     short                            numChannels;
  112.     unsigned long                    numSampleFrames;
  113.     short                            sampleSize;
  114.     extended80                        sampleRate;
  115. };
  116. typedef struct CommonChunk CommonChunk;
  117.  
  118. typedef CommonChunk *CommonChunkPtr;
  119.  
  120. struct ExtCommonChunk {
  121.     ID                                ckID;
  122.     long                            ckSize;
  123.     short                            numChannels;
  124.     unsigned long                    numSampleFrames;
  125.     short                            sampleSize;
  126.     extended80                        sampleRate;
  127.     ID                                compressionType;
  128.     char                            compressionName[1];            /* variable length array, Pascal string */
  129. };
  130. typedef struct ExtCommonChunk ExtCommonChunk;
  131.  
  132. typedef ExtCommonChunk *ExtCommonChunkPtr;
  133.  
  134. struct SoundDataChunk {
  135.     ID                                ckID;
  136.     long                            ckSize;
  137.     unsigned long                    offset;
  138.     unsigned long                    blockSize;
  139. };
  140. typedef struct SoundDataChunk SoundDataChunk;
  141.  
  142. typedef SoundDataChunk *SoundDataChunkPtr;
  143.  
  144. struct Marker {
  145.     MarkerIdType                    id;
  146.     unsigned long                    position;
  147.     Str255                            markerName;
  148. };
  149. typedef struct Marker Marker;
  150.  
  151. struct MarkerChunk {
  152.     ID                                ckID;
  153.     long                            ckSize;
  154.     unsigned short                    numMarkers;
  155.     Marker                            Markers[1];                    /* variable length array */
  156. };
  157. typedef struct MarkerChunk MarkerChunk;
  158.  
  159. typedef MarkerChunk *MarkerChunkPtr;
  160.  
  161. struct AIFFLoop {
  162.     short                            playMode;
  163.     MarkerIdType                    beginLoop;
  164.     MarkerIdType                    endLoop;
  165. };
  166. typedef struct AIFFLoop AIFFLoop;
  167.  
  168. struct InstrumentChunk {
  169.     ID                                ckID;
  170.     long                            ckSize;
  171.     UInt8                            baseFrequency;
  172.     UInt8                            detune;
  173.     UInt8                            lowFrequency;
  174.     UInt8                            highFrequency;
  175.     UInt8                            lowVelocity;
  176.     UInt8                            highVelocity;
  177.     short                            gain;
  178.     AIFFLoop                        sustainLoop;
  179.     AIFFLoop                        releaseLoop;
  180. };
  181. typedef struct InstrumentChunk InstrumentChunk;
  182.  
  183. typedef InstrumentChunk *InstrumentChunkPtr;
  184.  
  185. struct MIDIDataChunk {
  186.     ID                                ckID;
  187.     long                            ckSize;
  188.     UInt8                            MIDIdata[1];                /* variable length array */
  189. };
  190. typedef struct MIDIDataChunk MIDIDataChunk;
  191.  
  192. typedef MIDIDataChunk *MIDIDataChunkPtr;
  193.  
  194. struct AudioRecordingChunk {
  195.     ID                                ckID;
  196.     long                            ckSize;
  197.     UInt8                            AESChannelStatus[24];
  198. };
  199. typedef struct AudioRecordingChunk AudioRecordingChunk;
  200.  
  201. typedef AudioRecordingChunk *AudioRecordingChunkPtr;
  202.  
  203. struct ApplicationSpecificChunk {
  204.     ID                                ckID;
  205.     long                            ckSize;
  206.     OSType                            applicationSignature;
  207.     UInt8                            data[1];                    /* variable length array */
  208. };
  209. typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
  210.  
  211. typedef ApplicationSpecificChunk *ApplicationSpecificChunkPtr;
  212.  
  213. struct Comment {
  214.     unsigned long                    timeStamp;
  215.     MarkerIdType                    marker;
  216.     unsigned short                    count;
  217.     char                            text[1];                    /* variable length array, Pascal string */
  218. };
  219. typedef struct Comment Comment;
  220.  
  221. struct CommentsChunk {
  222.     ID                                ckID;
  223.     long                            ckSize;
  224.     unsigned short                    numComments;
  225.     Comment                            comments[1];                /* variable length array */
  226. };
  227. typedef struct CommentsChunk CommentsChunk;
  228.  
  229. typedef CommentsChunk *CommentsChunkPtr;
  230.  
  231. struct TextChunk {
  232.     ID                                ckID;
  233.     long                            ckSize;
  234.     char                            text[1];                    /* variable length array, Pascal string */
  235. };
  236. typedef struct TextChunk TextChunk;
  237.  
  238. typedef TextChunk *TextChunkPtr;
  239.  
  240.  
  241. #ifdef __CFM68K__
  242. #pragma lib_export off
  243. #endif
  244.  
  245. #if GENERATINGPOWERPC
  246. #pragma options align=reset
  247. #endif
  248.  
  249. #ifdef __cplusplus
  250. }
  251. #endif
  252.  
  253. #endif /* __AIFF__ */
  254.